import { getColorList } from '@/utils/color/theme'

/**
 * 获取主题色
 * @param systemConfig
 * @returns
 */
export const getThemeColor = systemConfig => {
  const colorTheme = getColorList()
  let currentIndex = 0
  colorTheme.forEach((item, index) => {
    if (item === systemConfig.value.theme.color) {
      currentIndex = index
    }
  })
  let newColorTheme = []
  newColorTheme = colorTheme.slice(currentIndex)
  newColorTheme = newColorTheme.concat(colorTheme.slice(0, currentIndex))
  return newColorTheme
}

/**
 * 获取文本主题色
 * @param systemConfig
 * @returns
 */
export const textThemeChange = systemConfig => {
  return systemConfig.value.isLight ? '#464646' : 'rgba(255,255,255,.8)'
}

/**
 * 获取 label 主题色
 * @param systemConfig
 * @returns
 */
export const labelThemeChange = systemConfig => {
  return systemConfig.value.isLight ? '#6e7079' : 'rgba(255,255,255,.5)'
}
